home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / C Internet Config / CInternetConfig ƒ / CInternetConfig.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-07  |  2.9 KB  |  90 lines  |  [TEXT/SPM ]

  1. /*
  2.     CInternetConfig.hpp
  3.     
  4.     Defines the CInternetConfig class.  This class is loosely based upon the IC Switch Glue.c file.
  5.     
  6. */
  7.  
  8. #pragma once
  9.  
  10. #ifndef __Hpp_CInternetConfig__
  11. #define __Hpp_CInternetConfig__
  12.  
  13. #include "IC Types.h"
  14. #include "IC Keys.h"
  15.  
  16. class CInternetConfig {
  17.     private:
  18.         ICInstance theInstance;
  19.         ICError lastError;
  20.         
  21.     protected:
  22.         
  23.     public:
  24.         // constructors & destructors
  25.         CInternetConfig(OSType type=(OSType)0);
  26.         ~CInternetConfig(void);
  27.         
  28.         OSErr MapICError(ICError err=(ICError)0);
  29.         OSErr GetLastError(void);
  30.         
  31.         // Specifying a configuration
  32.         OSErr FindConfigFile(short count=0,ICDirSpecArrayPtr folders=(ICDirSpecArrayPtr)0);
  33.         OSErr FindUserConfigFile(ICDirSpec* where);
  34.         OSErr GeneralFindConfigFile(Boolean search_prefs=true,Boolean can_create=true,
  35.             short count=0,ICDirSpecArrayPtr folders=(ICDirSpecArrayPtr)0);
  36.         OSErr ChooseConfig(void);
  37.         OSErr ChooseNewConfig(void);
  38.         OSErr GetConfigName(StringPtr name,Boolean longname=false);
  39.         OSErr GetConfigReference(ICConfigRefHandle ref);
  40.         OSErr SetConfigReference(ICConfigRefHandle ref,long flags);
  41.         OSErr SpecifyConfigFile(FSSpecPtr spec);
  42.         
  43.         // Getting Information
  44.         OSErr GetSeed(long* seed);
  45.         OSErr GetPerm(ICPerm* perm);
  46.         OSErr DefaultFileName(StringPtr name);
  47.         OSErr GetComponentInstance(Ptr* component_inst);
  48.         
  49.         // Reading And Writing Preferences
  50.         OSErr Begin(ICPerm perm);
  51.         OSErr GetPref(const StringPtr key,ICAttr* attr,Ptr buf,long* size);
  52.         OSErr SetPref(const StringPtr key,ICAttr attr,Ptr buf,long size);
  53.         OSErr FindPrefHandle(const StringPtr key,ICAttr* attr,Handle prefh);
  54.         OSErr GetPrefHandle(const StringPtr key,ICAttr* attr,Handle* prefh);
  55.         OSErr SetPrefHandle(const StringPtr key,ICAttr attr,Handle prefh);
  56.         OSErr CountPref(long* count);
  57.         OSErr GetIndPref(long n,StringPtr key);
  58.         OSErr DeletePref(const StringPtr key);
  59.         OSErr End(void);
  60.         
  61.         // User Interface Stuff
  62.         OSErr EditPreferences(const StringPtr key);
  63.         
  64.         // URL Handling
  65.         OSErr ParseURL(StringPtr hint,Ptr data,long len,long* selStart,long* selEnd,Handle url);
  66.         OSErr LaunchURL(StringPtr hint,Ptr data,long len,long* selStart,long* selEnd);
  67.         
  68.         // Mapping Routines
  69.         
  70.         // High Level
  71.         OSErr MapFilename(StringPtr filename,ICMapEntry* entry);
  72.         OSErr MapTypeCreator(OSType fType,OSType fCreator,StringPtr filename,ICMapEntry* entry);
  73.         
  74.         // Mid Level
  75.         OSErr MapEntriesFilename(Handle entries,StringPtr filename,ICMapEntry* entry);
  76.         OSErr MapEntriesTypeCreator(Handle entries,OSType fType,OSType fCreator,StringPtr filename,
  77.             ICMapEntry* entry);
  78.         
  79.         // Low Level
  80.         OSErr CountMapEntries(Handle entries,long* count);
  81.         OSErr GetIndMapEntry(Handle entries,long ndx,long* pos,ICMapEntry* entry);
  82.         OSErr GetMapEntry(Handle entries,long pos,ICMapEntry* entry);
  83.         OSErr SetMapEntry(Handle entries,long pos,ICMapEntry* entry);
  84.         OSErr DeleteMapEntry(Handle entries,long pos);
  85.         OSErr AddMapEntry(Handle entries,ICMapEntry* entry);
  86. };
  87.  
  88. #endif /* __Hpp_CInternetConfig__ */
  89.  
  90.